# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=kodi-peripheral-joystick
pkgver=19.0.1
_realname=Matrix
pkgrel=0
pkgdesc="Kodi joystick support (drivers and button maps)"
options="!check" # no test suite
url="https://github.com/xbmc/peripheral.joystick"
arch="x86 x86_64 aarch64 armv7" # kodi is available only on those architectures
license="GPL-2.0-only"
makedepends="cmake kodi-dev tinyxml-dev"
source="$pkgname-$pkgver-$_realname.tar.gz::https://github.com/xbmc/peripheral.joystick/archive/$pkgver-$_realname.tar.gz"
builddir="$srcdir/peripheral.joystick-$pkgver-$_realname"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake/kodi \
		-DUSE_LTO=1
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="
39e1341ee24b8e04aa3afde6300e25b316e79eccb98854c23a668f99997132ee97d7adc131a788b45d3830513c66bf467fc4de942f26981fb4be9d3c83976aae  kodi-peripheral-joystick-19.0.1-Matrix.tar.gz
"
